TrafficLight Class Reference

#include <TrafficLight.h>

Inheritance diagram for TrafficLight:

TraffEduObject List of all members.

Public Member Functions

 TrafficLight (OSGWindows *osgwind__)
 TrafficLight (OSGWindows *osgwind, TrafficLightTypes newType, TrafficLightColor newColor, TrafficLightColor newArrowColor=YESIL)
 ~TrafficLight ()
void setColor (TrafficLightColor color)
void draw (osg::ref_ptr< osg::Group > root, int animationFlag=-1)
TrafficLightColor getColor ()
TrafficLightColor getArrowColor ()
TrafficLightTypes getTrafficLightType ()
void setNewFramesLightColor (int oldFrameId, int newFrameId)
void changeColor (int frameId)
void changeColorAnim (int frameId)
void fillColorArray (TrafficLightColor newcolor)
TrafficLightColor getFrameColor (int frameId)
void setFrameColor (int frameId, int color)

Public Attributes

osg::ref_ptr< osg::Sequence > seqNode

Private Attributes

TrafficLightTypes lightType
TrafficLightColor color
TrafficLightColor arrowColor
int colorArray [101]
OSGWindows * osgwind_

Detailed Description

TrafficLight class. A data fundemental class for Traffic Lights.

Definition at line 5 of file TrafficLight.h.


Constructor & Destructor Documentation

TrafficLight::TrafficLight (  OSGWindows *  osgwind__  ) 
 

Constructor for the Traffic Light. The Ligth is created with default parameters.

Parameters:
osgwind__ a pointer to the OSGWindows in which the object will be created.
See also:
TrafficLight();

Definition at line 30 of file TrafficLight.cpp.

References arrowColor, color, colorArray, LIGHT, lightType, NORMAL_ISIK, TraffEduObject::objectGroup, osgwind_, seqNode, TraffEduObject::setObjectId(), TraffEduObject::setObjectType(), and YESIL.

TrafficLight::TrafficLight (  OSGWindows *  osgwind,
TrafficLightTypes  newType,
TrafficLightColor  newColor,
TrafficLightColor  newArrowColor = YESIL
) 
 

Constructor for the Traffic Light.

Parameters:
osgwind a pointer to the OSGWindows in which the object will be created.
newType type of the traffic light
newColor color of the light
newArrowColor color of the arrow.
See also:
TrafficLight();

Definition at line 44 of file TrafficLight.cpp.

References arrowColor, color, fillColorArray(), LIGHT, lightType, TraffEduObject::objectGroup, osgwind, osgwind_, seqNode, TraffEduObject::setObjectId(), and TraffEduObject::setObjectType().

TrafficLight::~TrafficLight (   ) 
 

A destructor for the Traffic Light.

Definition at line 57 of file TrafficLight.cpp.


Member Function Documentation

void TrafficLight::changeColor (  int  frameId  ) 
 

Responsible from the color change of the Traffic Light.

Parameters:
frameId specifies in which frame to change the color

Definition at line 98 of file TrafficLight.cpp.

References colorArray, getFrameColor(), TraffEduObject::objectGroup, and TrafficModel::trafficLight().

void TrafficLight::changeColorAnim (  int  frameId  ) 
 

Resonsible from changing the color of the Traffic Light during animation.

Parameters:
frameId specifies in which frame to change the color

Definition at line 106 of file TrafficLight.cpp.

References getFrameColor(), TraffEduObject::objectGroup, and TrafficModel::trafficLight().

void TrafficLight::draw (  osg::ref_ptr< osg::Group >  root,
int  animationFlag = -1
)  [virtual]
 

The function responsible from the addition of Traffic Light to the scene root.

Parameters:
root osg::ref_ptr<osg::Group> where to add the light object.
animationFlag whether the object is an active object in the animation.

Implements TraffEduObject.

Definition at line 70 of file TrafficLight.cpp.

References TraffEduObject::addTree(), TraffEduObject::objectGroup, and seqNode.

void TrafficLight::fillColorArray (  TrafficLightColor  newcolor  ) 
 

Responsible from filling the color array of a TrafficLight. Each Traffic Light holds a coor array in which they hold the color values of the light in each frame.

Parameters:
newcolor variable of enum type TrafficLightColor

Definition at line 114 of file TrafficLight.cpp.

References colorArray, SARI, and YESIL.

Referenced by TrafficLight().

TrafficLightColor TrafficLight::getArrowColor (   )  [inline]
 

Getter for the arrow color of the TrafficLight

Returns:
TrafficLightColor

Definition at line 59 of file TrafficLight.h.

References arrowColor.

TrafficLightColor TrafficLight::getColor (   )  [inline]
 

Getter for the color of the TrafficLight

Returns:
TrafficLightColor

Definition at line 53 of file TrafficLight.h.

References color.

TrafficLightColor TrafficLight::getFrameColor (  int  frameId  ) 
 

Getter for the color of the TrafficLigth for a specific frame.

Parameters:
frameId the identifier for the frame.
Returns:
color of the TrafficLight.

Definition at line 133 of file TrafficLight.cpp.

References colorArray, KIRMIZI, SARI, and YESIL.

Referenced by changeColor(), changeColorAnim(), and AnimationWindow::generateSeq().

TrafficLightTypes TrafficLight::getTrafficLightType (   )  [inline]
 

Getter for the type of the TrafficLight

Returns:
TrafficLightType

Definition at line 65 of file TrafficLight.h.

References lightType.

void TrafficLight::setColor (  TrafficLightColor  color  ) 
 

Setter for the light of the Traffic Light.

Parameters:
color a variable to which color to set the light.

Definition at line 157 of file TrafficLight.cpp.

References color.

void TrafficLight::setFrameColor (  int  frameId,
int  color
) 
 

Setter for the color of TrafficLight for a specific frame.

Parameters:
frameId the identifier for the frame.
color specifies the color to set

Definition at line 143 of file TrafficLight.cpp.

References colorArray.

void TrafficLight::setNewFramesLightColor (  int  oldFrameId,
int  newFrameId
) 
 

Setter for the color of the TrafficLight in frame

Parameters:
oldFrameId an integer variable
newFrameId an integer variable

Definition at line 152 of file TrafficLight.cpp.

References colorArray.


Member Data Documentation

TrafficLightColor TrafficLight::arrowColor [private]
 

Definition at line 9 of file TrafficLight.h.

Referenced by getArrowColor(), and TrafficLight().

TrafficLightColor TrafficLight::color [private]
 

Definition at line 8 of file TrafficLight.h.

Referenced by getColor(), setColor(), and TrafficLight().

int TrafficLight::colorArray[101] [private]
 

Definition at line 10 of file TrafficLight.h.

Referenced by changeColor(), fillColorArray(), getFrameColor(), setFrameColor(), setNewFramesLightColor(), and TrafficLight().

TrafficLightTypes TrafficLight::lightType [private]
 

Definition at line 7 of file TrafficLight.h.

Referenced by getTrafficLightType(), and TrafficLight().

OSGWindows* TrafficLight::osgwind_ [private]
 

Definition at line 11 of file TrafficLight.h.

Referenced by TrafficLight().

osg::ref_ptr<osg::Sequence> TrafficLight::seqNode
 

A public pointer to Sequence Node.

Definition at line 111 of file TrafficLight.h.

Referenced by draw(), AnimationWindow::generateSeq(), and TrafficLight().


The documentation for this class was generated from the following files:
Generated on Sun May 28 18:54:15 2006 for TraffEdu by  doxygen 1.4.6-NO